<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<!DOCTYPE html>
<html lang="zh-CN">
	<head>
    <title>管理入口-用户信息列表</title>
    
    <%@ include file="../common.jsp" %>
	<script type="text/javascript" src="${path }/static/vender/jquery/jquery.pagination.js"></script>

  </head>

  <body>
	<jsp:include page="${pagePath }/header.jsp">
		<jsp:param value="2" name="active"/>
	</jsp:include>
  	
    <div class="container-fluid">
      <div class="row">
      	<div class="col-sm-3 col-md-2 sidebar">
			<jsp:include page="left_navbar.jsp">
				<jsp:param value="1" name="active"/>
			</jsp:include>
		</div>
		
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2">
          <h3 class="page-header">设备列表<a href="./add" class="btn btn-info pull-right">&nbsp;添加设备&nbsp;</a>
          </h3>

          <div class="table-responsive">
            <table class="table table-striped">
              <thead>
                <tr>
                  <th>#</th>
                  <th>设备编号</th>
                  <th>设备名称</th>
                  <th>设备版本</th>
                  <th>经度</th>
                  <th>纬度</th>
                  <th>地址</th>
                  <th>备注</th>
                  <th>探针MAC列表</th>
                  <th>最后更新时间</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
             	<c:forEach var="dev" varStatus="idx" items="${devices }">
             		<tr>
	                  <td>${idx.index+1 }</td>
	                  <td>${dev.devNo }</td>
	                  <td>${dev.devName }</td>
	                  <td>${dev.devVersion }</td>
	                  <td>${dev.longitude }</td>
	                  <td>${dev.latitude }</td>
	                  <td>${dev.addr }</td>
	                  <td>${dev.remark }</td>
	                  <td>${dev.macList }</td>
	                  <td>${dev.lastActiveTime }</td>
	                  <td>
	                  	<a href="${path }/dev/del?devNo=${dev.devNo }" onclick="return confirm('确定删除吗？')" class="btn btn-primary">删除</a> 
	                  	<a href="./detail?id=${dev.id }" class="btn btn-primary">配置</a> 
	                  </td>
					</tr>
             	</c:forEach>
              </tbody>
            </table>
          </div>
        </div>
      </div>
    </div>
    
	<form action="list" id="queryForm" method="post" style="display: none"></form>
	
	<!-- 设备添加面板::start -->
	<div id="addDevPanel" class="modal fade">
	  <div class="modal-dialog">
	    <div class="modal-content">
	      <div class="modal-header">
	        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
	        <span aria-hidden="true">&times;</span></button>
	        <h4 class="modal-title">添加设备</h4>
	      </div>
	      <div class="modal-body">
	        <form id="addWalkerForm">
              <div class="form-group">
                <label for="recipient-name" class="control-label">用户名:</label>
                <input type="text" class="form-control" check-type="required" id="userName">
              </div>
              <div class="form-group">
                <label for="message-text" class="control-label">密码:</label>
                <input type="text" class="form-control" check-type="required" id="password">
              </div>
              <div class="form-group">
                <label for="message-text" class="control-label">角色:</label>
                <select id="roleId" class="form-control">
                   	<option value="0" selected  >普通用户</option>
                   	<option value="1"  >健步组长</option>
                   	<option value="999"  >管理员</option>
                 </select>
              </div>
              <div class="form-group">
                <div id="msgDiv" class="alert alert-success" style="display:none;" role="alert"></div>
              </div>
            </form>
	      </div>
	      <div class="modal-footer">
	        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
	        <button id="saveRectBtn" type="button" class="btn btn-primary">保存</button>
	      </div>
	    </div><!-- /.modal-content -->
	  </div><!-- /.modal-dialog -->
	</div><!-- /.modal -->
	<!-- 设备添加面板::end -->
	
	<!-- 设备配置面板::start -->
	<div id="devCfgPanel" class="modal fade">
	  <div class="modal-dialog">
	    <div class="modal-content">
	      <div class="modal-header">
	        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
	        <span aria-hidden="true">&times;</span></button>
	        <h4 class="modal-title">设备配置</h4>
	      </div>
	      <div class="modal-body">
	        <form id="addWalkerForm">
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <div class="form-group">
                <label for="recipient-name" class="control-label">管理URL:</label>
                <input type="text" class="form-control" check-type="required" id="manageUrl">
              </div>
              <!-- <div class="form-group">
                <label for="message-text" class="control-label">角色:</label>
                <select id="roleId" class="form-control">
                   	<option value="0" selected  >普通用户</option>
                   	<option value="1"  >健步组长</option>
                   	<option value="999"  >管理员</option>
                 </select>
              </div> -->
              <div class="form-group">
                <div id="devCfgMsgDiv" class="alert alert-success" style="display:none;" role="alert"></div>
              </div>
            </form>
	      </div>
	      <div class="modal-footer">
	        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
	        <button id="saveDevCfgBtn" type="button" class="btn btn-primary">保存</button>
	      </div>
	    </div><!-- /.modal-content -->
	  </div><!-- /.modal-dialog -->
	</div><!-- /.modal -->
	<!-- 设备配置面板::end -->
	
	
	<jsp:include page="${pagePath }/paginator.jsp">
		<jsp:param name="form" value="#queryForm" />
	</jsp:include>
	
	<jsp:include page="${pagePath }/footer.jsp"></jsp:include>

	<script type="text/javascript">
		var currentUserId;
		
	</script>
	<script type="text/javascript" src="${path }/static/js/device/list.js"></script>
</body></html>